package com.tarena.baking.common.enums;

import lombok.Getter;
import org.apache.commons.lang3.EnumUtils;

import java.util.Arrays;
import java.util.Enumeration;
import java.util.Objects;

@Getter
public enum ContentTypeEnum {

    RECIPES(1L, "食谱"),
    VIDEO(2L, "视频"),
    INFORMATION(3L, "资讯");

    ContentTypeEnum(Long value, String message) {
        this.value = value;
        this.message = message;
    }

    public static boolean isValidEnum(Long value) {
        return Arrays.stream(ContentTypeEnum.values()).anyMatch(o -> Objects.equals(o.getValue(), value));
    }

    private Long value;

    private String message;
}
